package com.szc.demo01.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.szc.demo01.dao.UserMapper;
import com.szc.demo01.pojo.User;
import com.szc.demo01.pojo.dto.UserDto;
import com.szc.demo01.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public User getByUsernameAndPasswordUser(User user) {
        User sUser = userMapper.getByUsernameAndPasswordUser(user);
        return sUser;
    }

    @Override
    public List<UserDto> getAllUserDto() {

        return userMapper.getAllUserDto();
    }
}
